package com.wondertek.service.mapper.business;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wondertek.service.dto.business.res.DerConfigFindRes;
import com.wondertek.service.entity.business.DeviceErrorRecordConfigPo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author wangyu
 */
public interface DeviceErrorRecordConfigMapper extends BaseMapper<DeviceErrorRecordConfigPo> {

    @Select("select protocol_type,primary_address_ip,primary_address_port,alternative_address_ip,alternative_address_port,ip_protocol,heartbeat_interval,account,report_events from device_error_record_config where device_sn = #{deviceSn}")
    DerConfigFindRes findDerConfigFindRes(@Param("deviceSn") String deviceSn);

    @Delete("delete from device_error_record_config where device_sn = #{deviceSn}")
    void delDerConfigFindRes(@Param("deviceSn") String deviceSn);
}
